<extend name="Public:base"/>

<block name="main">
<div id="yzh-content" class="col-xs-12">
    <div class="main-title">
        <h2>编辑栏目</h2>
    </div>

    <load href="./Public/js/swfupload.js"/>

    <div class="row">
        <div class="col-md-12">
            <form id="myform" name="myform" class="form-horizontal" action="{:U('Wap/editCat')}" method="post">

                <div class="form-group">
                    <label class="control-label col-md-2">pc栏目名称</label>
                    <div class="col-md-6">
                        <input type="text" name="catname" class="form-control" value="{$vo['catname']}"  readonly/></div>
                </div>
                <div class="form-group">
                    <label class="control-label col-md-2">手机栏目名称</label>
                    <div class="col-md-6">
                        <input type="text" name="catname" class="form-control" value="{$vo['wap_catname']}"  /></div>
                </div>
                <div class="form-group env-class" >
                    <label class="control-label col-md-2">手机导航</label>
                    <div class="col-md-8">
                        <div class="selectstyle">{:Form::radio(array('field'=>'is_wap_menu','options'=>array('1'=>L('yes'),'0'=>L('no'))),$vo['is_wap_menu'])}</div>
                    </div>
                </div>
                <div class="form-group">
                    <label class="control-label col-md-2">列表页模板</label>
                    <div class="col-md-8">
                        <select name="template_list" class="form-control w-300 pull-left">
                            <volist name="templates" id="tem">
                                <option value="{$tem['value']}">{$tem['filename']}</option>
                            </volist>
                        </select>
                        &nbsp;&nbsp;
                        <input type="checkbox" class="input_checkbox pull-left" id="listtype" name="listtype"  onclick="javascript:templatetype();" value="1"  <if condition="!empty($vo['listtype'])">checked</if> />
                        {:L('listtype')}
                    </div>
                </div>

                <div class="form-group">
                    <label class="control-label col-md-2">内容页模板</label>
                    <div class="col-md-8">
                        <select name="template_show" class="form-control w-300">
                            <volist name="templates" id="tem">
                                <option value="{$tem['value']}">{$tem['filename']}</option>
                            </volist>
                        </select>
                    </div>
                </div>

                <div class="form-actions">
                    <input type="hidden" name="id" value="{$vo.id}">
                    <input type="submit" value="提交" class="btn btn-sm btn-primary" >
                    <input type="reset" value="取消" class="btn btn-sm btn-primary">

                </div>
            </form>

        </div>
    </div>

</div>
</block>
<block name="script">
    <script type="text/javascript">
        /*$(document).ready(function() {
         $('#myform').ajaxForm({
         success:  complete,  // post-submit callback
         dataType: 'json'
         });
         });*/

        function complete(data){
            if(data.status==1){
                art.dialog({
                    icon: 'succeed',
                    time: 2,
                    content: data.info,
                    close: function() {
                        window.location.href = "{:U('GoodsCategory/index')}";
                        return true;
                    }
                });
            }else{
                art.dialog({
                    icon: 'error',
                    time: 2,
                    content: data.info,
                });
            }

        }
    </script>
    <script>
        $('.thumb_image a').click(function(){
            swfupload('image_uploadfile','image','{$yzh_auth}',yesdo);
        });

        function urlrule(m){
            if(m==1){
                $('#urlrule').show();
            }else{
                $('#urlrule').hide();
            }
        }

        urlrule({$vo['ishtml']});

        <if condition="!empty($_GET['type'])">
                $('#moduleid').val(0);
        changetemplate(0);
        </if>
    </script>
</block>